package com.shf.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.ibatis.type.Alias;

import java.util.List;

/**
 * (User)实体类
 *
 * @author makejava
 * @since 2023-10-13 20:04:10
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Alias("users")
public class Users {


    private String id;

    private String username;
    private String password;
    private String email;
    private String phoneNum;

    private Integer status;
    /**状态显示文本*/
    private String statusStr;
    private List<Role> roles;


    public String getStatusStr() {

        if (status == 0){
            statusStr = "关闭";
        }
        if (status == 1){
            statusStr = "开启";
        }
        if (status == null){
            statusStr = "";
        }
        return statusStr;
    }
}

